//
//  GoodsDetailController.m
//  类似淘宝详情页
//
//  Created by songhuipan on 16/6/26.
//  Copyright © 2016年 songhuipan. All rights reserved.
//
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#import "GoodsDetailController.h"
#import "TopView.h"

@interface GoodsDetailController ()
@property (nonatomic,strong)UIWebView *webView;
@property (nonatomic,strong)TopView *topView;
@end
@implementation GoodsDetailController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.topView];
    
    
    UIButton *detailButton = [[UIButton alloc]init];
    detailButton.backgroundColor = [UIColor blueColor];
    [detailButton setTitle:@"图文详情" forState:UIControlStateNormal];
    [detailButton addTarget:self action:@selector(detailButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.topView addSubview:detailButton];
    UIButton *commentButton = [[UIButton alloc]init];
    commentButton.backgroundColor = [UIColor blueColor];
    [commentButton setTitle:@"用户评价" forState:UIControlStateNormal];
    [commentButton addTarget:self action:@selector(commentButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.topView addSubview:commentButton];
}
# pragma buttonClick
- (void)detailButtonClick:(UIButton *)sender {
    NSLog(@"图文详情");
}
- (void)commentButtonClick:(UIButton *)sender {
    NSLog(@"用户评价");
}
- (UIWebView *)webView {
    if (!_webView) {
        _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, kScreenHeight, kScreenWidth, kScreenHeight)];
        _webView.backgroundColor = [UIColor blueColor];
    }
    return _webView;
}
- (TopView *)topView {
    if (!_topView) {
        _topView = [[TopView alloc]initWithFrame:CGRectMake(0, 64, kScreenWidth, 44)];
    }
    return _topView;
}
@end
